package ru.eas.graph;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class TheSameConnectedComponent {

    public static void main(String[] args) {
//        String testString = "4 3\n" +
//                "1 2\n" +
//                "3 2\n" +
//                "4 3\n" +
//                "1 4";
//        Scanner scanner = new Scanner(testString);

        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();

        UndirectedGraph graph = new UndirectedGraph(n);
        for (int i = 0; i < m; i++) {
            graph.addEdge(scanner.nextInt(), scanner.nextInt());
        }
        int vertex1 = scanner.nextInt();
        int vertex2 = scanner.nextInt();
        System.out.print(graph.areInOneConnectedComponent(vertex1, vertex2) ? "True" : "False");
    }

    static class UndirectedGraph {
        private List<List<Integer>> data;
        private boolean[] visited;

        public UndirectedGraph(int vertexCount) {
            vertexCount++;
            data = new ArrayList<List<Integer>>(vertexCount);
            for (int i = 0; i < vertexCount; i++) {
                data.add(new ArrayList<Integer>());
            }
            visited = new boolean[vertexCount];
        }

        public void addEdge(int vertex1, int vertex2) {
            data.get(vertex1).add(vertex2);
            data.get(vertex2).add(vertex1);
        }

        public boolean areInOneConnectedComponent(int vertex1, int vertex2) {
            for (int i = 0; i < visited.length; i++) {
                visited[i] = false;
            }
            return search(vertex1, vertex2);
        }

        public boolean search(int vertex, int targetVertex) {
            visited[vertex] = true;
            if (vertex == targetVertex) {
                return true;
            }
            for (int v : data.get(vertex)) {
                if (visited[v] == false && search(v, targetVertex)) {
                    return true;
                }
            }
            return false;
        }
    }
}
